home *** CD-ROM | disk | FTP | other *** search
/ Graphics & Sound Program…ng Techniques for the Mac / Graphics and Sound Programming Techniques for the Mac.iso / Goodies / Graphics / Pict2ppat™ ƒ / Example ppat Source Code / Symantec Example / ppat User / ppatUser.c < prev    next >
C/C++ Source or Header  |  1995-08-14  |  1KB  |  52 lines

  1. //____________________________________________________________
  2. //    ppatUser.c
  3. //
  4. //    Copyright © Dan Parks Sydow, 1995
  5. //    From the CD that accompanies the book:
  6. //    "Graphics and Sound Programming Techniques for the Mac",
  7. //    M&T Books, 1995
  8.  
  9.  
  10. //____________________________________________________________
  11.  
  12. #define   rRobotPixelPattern      128
  13. #define   rDisplayWindow          128
  14.  
  15.  
  16. //____________________________________________________________
  17.  
  18. void  main( void ) 
  19. {
  20.    WindowPtr     theWindow;
  21.    PixPatHandle  theRobotPixPat;
  22.    Rect          theRect;
  23.    
  24.    InitGraf( &qd.thePort ); 
  25.    InitFonts(); 
  26.    InitWindows(); 
  27.    InitMenus(); 
  28.    TEInit(); 
  29.    InitDialogs( 0L );    
  30.    FlushEvents( everyEvent, 0L ); 
  31.    InitCursor(); 
  32.  
  33.    theWindow = GetNewCWindow( 128, nil, (WindowPtr)-1L );                         
  34.    SetPort( theWindow );
  35.  
  36.    theRobotPixPat = GetPixPat( rRobotPixelPattern ); 
  37.    PenPixPat( theRobotPixPat );
  38.  
  39.    PenSize( 20, 20 ); 
  40.    MoveTo( 30, 270 ); 
  41.    Line( 400, 70 );   
  42.  
  43.    SetRect( &theRect, 10, 10, 450, 260 );
  44.    PaintRect( &theRect );
  45.  
  46.    while ( !Button() )
  47.       ;
  48. }
  49.  
  50.  
  51.  
  52.